package com.bearhy.jqadmin.controller;

import com.bearhy.jqadmin.common.MenuModel;
import com.bearhy.jqadmin.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/sys")
public class SystemController {

    @Autowired
    private SysMenuService sysMenuService;

    @RequestMapping("/menu")
    @ResponseBody
    public List<MenuModel> menu(){
        List<MenuModel> menus = sysMenuService.getMenus("1,2,3,4,5,");
        return menus;
    }

    @RequestMapping("/resource")
    public String resource(){
        return "menu";
    }

    @RequestMapping("welcome")
    public String welcome(){
        return "welcome";
    }
}
